﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Betop.Lib.Core.Base;

namespace Betop.Lib.Core.Log.Message
{
    public class LogMessageBO : CommonOperate<LogMessageInfo>
    {
        private LogMessageDAL _logMessage;
        public LogMessageBO()
        {
            _logMessage = new LogMessageDAL();
        }

        protected override BaseDAL DAL
        {
            get
            {
                return _logMessage;
            }
        }    

        public void Write(string message, string name)
        {
            LogMessageInfo info = new LogMessageInfo();
            info.ID = Guid.NewGuid();
            info.InputTime = DateTime.Now;
            info.Message = message;
            info.Name = name;
            this.Save(info, true);
        }

        public void Delete()
        {
            _logMessage.Delete();
        }

        public void Delete(string startTime, string endTime)
        {
            _logMessage.Delete(startTime, endTime);

        }
    }
}
